//pizza
package ${model.packageName};

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import com.googlecode.jsonplugin.annotations.JSON;
import cn.framework.dao.*;
import ${model.modelClass};
import java.util.*;

@Controller
public class ${model.actionClassName} extends BaseExtAction {
	@Autowired
	${model.className}Dao defaultDao;
	List defaultList;
	
	${model.className} ${model.objName};
		
	@Override
	public String defaultList() {
		defaultList=defaultDao.findAll(start, limit);
		totalProperty=defaultDao.getCount();
		return SUCCESS;
	}

	@Override
	public String del() {
		int id=Integer.parseInt(getRequest().getParameter("id"));
		${model.objName}=(${model.className}) defaultDao.findById(id);
		success=defaultDao.delete(${model.objName});
		return SUCCESS;
	}

	@Override
	public String save() {
		success=(defaultDao.save(${model.objName})!=null);
		return SUCCESS;
	}

	@Override
	public String seach() {
		getSeachWord();
		//TODO 请写入seach操作,SeachWord为查询条件
		return SUCCESS;
	}

	@Override
	public String update() {
		success=(defaultDao.update(${model.objName})!=null);
		return SUCCESS;
	}

	@Override
	public int getTotalProperty() {
		return super.getTotalProperty();
	}

	//判断操作是否成功
	public boolean getSuccess(){
		return super.isSuccess();
	}
	
	@JSON(name="defaultList")
	public List getDefaultList() {
		return defaultList;
	}

	public void setDefaultList(List defaultList) {
		this.defaultList = defaultList;
	}
	
	public ${model.className} get${model.className}() {
		return ${model.objName};
	}

	public void set${model.className}(${model.className} ${model.objName}) {
		this.${model.objName} = ${model.objName};
	}
	
}
